Skip to content

feat: interactive mindmap with expand/collapse, zoom, node-ask, multi-format export#16

Open
Anionex wants to merge 5 commits intoOpenDCAI:mainfrom
Anionex:feat/interactive-mindmap
Open

feat: interactive mindmap with expand/collapse, zoom, node-ask, multi-format export#16
Anionex wants to merge 5 commits intoOpenDCAI:mainfrom
Anionex:feat/interactive-mindmap

Conversation

@Anionex
Copy link
Copy Markdown

@Anionex Anionex commented Mar 31, 2026

Summary

  • Replace static Mermaid.js mindmap with interactive simple-mind-map library
  • Merge two-step LLM pipeline into single-pass with improved knowledge-map prompt
  • Add full mindmap interaction: expand/collapse all, zoom/pan/fit, node-level expand/collapse
  • Add export: PNG (fully expanded with padding), hierarchical TXT, Mermaid code
  • Add click-to-ask: click node → contextual question popover (2 options) → auto-fill chat input
  • Fix preview modal missing rounded corners and backdrop blur
  • Prompt retains concrete data/numbers, adapts to article type

Changes

  • Backend: Single-pass prompt with data-aware generation, max_depth=6 (route + state aligned)
  • Frontend: New MindMapPreview component, mermaidToMarkdown/markdownToMermaid utils, TS declarations
  • Dependencies: +simple-mind-map, -mermaid

Commits

  1. edfb7d0 — Backend: single-pass prompt + max_depth=6
  2. 9e8faff — Dependencies + format conversion utils + TS declarations
  3. a5fbc3e — MindMapPreview component + interactions + modal fix
  4. 4d438b3 — Code review fixes (debug logs, dead state, deps)
  5. 29e9656 — PNG export truncation fix (padding + fit before capture)

Test plan

  • Generate mindmap from uploaded document, verify interactive rendering
  • Test expand/collapse all buttons and node-level expand/collapse
  • Test zoom (scroll), pan (drag), fit button
  • Export PNG, TXT, Mermaid and verify output
  • Click node → verify popover with 2 question options
  • Select question → verify modal closes, chat input filled, input focused
  • Open old .mmd files in knowledge base → verify backward compatibility
  • PNG export captures full content without truncation

@Anionex Anionex changed the title feat: replace Mermaid with interactive mindmap (simple-mind-map) feat: 交互式思维导图 — 展开收缩、缩放拖拽、节点提问、多格式导出 Mar 31, 2026
@Anionex Anionex changed the title feat: 交互式思维导图 — 展开收缩、缩放拖拽、节点提问、多格式导出 feat: interactive mindmap with expand/collapse, zoom, node-ask, multi-format export Mar 31, 2026
@Anionex Anionex marked this pull request as draft March 31, 2026 09:00
Anionex added 3 commits March 31, 2026 19:05
- Merge two-step LLM pipeline (analyze + generate) into one call
- Comprehensive prompt: adapts to article type, retains data/numbers,
  structures as topic modules with clear hierarchy
- max_depth default 6 (aligned in route and state)
- Replace mermaid with simple-mind-map in both frontends
- Add mermaidToMarkdown (indent-stack) and markdownToMermaid converters
- Add TypeScript declarations for simple-mind-map
- New MindMapPreview component (simple-mind-map): expand/collapse all,
  zoom/pan/fit, always-visible expand buttons, PNG/TXT/Mermaid export
- Click-to-ask popover: two contextual question options per node,
  closes modal, switches to chat, focuses input
- Fix preview modal: replace missing iOS Tailwind classes with standard
  rounded corners and backdrop blur
- Hide redundant download button for mindmap in modal header
- Delete old MermaidPreview component
@Anionex Anionex force-pushed the feat/interactive-mindmap branch from 9071ed8 to a5fbc3e Compare March 31, 2026 11:05
- Remove console.log debug statements from ZH MindMapPreview
- Remove unused isReady state from both EN/ZH components
- Keep useCallback/useEffect deps as [mermaidCode] (no self-reference)
@Anionex Anionex force-pushed the feat/interactive-mindmap branch from ddd9c9b to 4d438b3 Compare March 31, 2026 11:24
- exportPadding 20→50 to prevent bottom/right clipping
- After EXPAND_ALL, call view.fit() before export to ensure full layout
@Anionex Anionex marked this pull request as ready for review March 31, 2026 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant